package aoi

/*import(
	"github.com/golang/protobuf/proto"
)*/

type Position struct {
	X int32
	Y int32
}

type AOIObject interface {
	//	BrocastToObserver(msg proto.Message,except map[AOIObject]bool)    //将msg广播给能看到自己的所有对象(除去except里面)
	//	Send(msg proto.Message)                                     //向AOI对象发送msg
	GetAoiPosition() *Position //获取当前对象的AOI坐标
	SetAoiPosition(Position)
	GetGrid() *Grid
	SetGrid(*Grid)
	AddObserver(AOIObject)
	RemoveObserver(AOIObject)
	ForEachObserver(func(AOIObject))
	ClearObjserver()
	OnAoiUpdate()
}

type AOIObjectBase struct {
	Observers map[AOIObject]bool //能观察到当前对象的所有AOI对象
	AoiPos    Position
	Grid      *Grid //归属的单元格
}

/*func (this *AOIObjectBase) Brocast(msg proto.Message,except map[AOIObject]bool) {
	for k,_ := range(this.Observers) {
		if _,ok := except[k];!ok{
			k.Send(msg)
		}
	}
}*/
